import {Injectable} from "@angular/core";
import {HttpClient} from "@angular/common/http";
import {GnMessageService} from "geminis-ng";

@Injectable({
  providedIn: "root"
})
export class Config {

  loginUrl: string;
  checkCode: boolean;

  constructor(httpClient: HttpClient,
              messageService: GnMessageService) {
    httpClient.get("assets/siteInfo.json").subscribe((value: any) => {
        this.loginUrl = value.resources.loginUrl;
        this.checkCode = value.resources.checkCode;
      },
      error => {
        messageService.error({message: '获取系统信息错误', error: error});
      });
  }

}
